﻿@{
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<style type="text/css">
    .acceptl1-table thead tr {
        height: 47px;
    }

    .acceptl1-table tbody tr td {
        vertical-align: middle !important;
    }
</style>
<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try {
            ace.settings.check('breadcrumbs', 'fixed');
        } catch (e) { }
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="/Home">Trang chủ</a>
        </li>

        <li>
            <a href="javascript:void(0);">Campain</a>
        </li>
        <li class="active">Danh sách Campain</li>
    </ul>
</div>

<div class="page-content">
    <div class="page-header">
        <h1>Danh sách Campain							
        </h1>
    </div>
    <!-- /.page-header -->

    <div class="row">
        <div class="col-xs-12">
            <div id="spiner"></div>
        </div>
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            @using (Ajax.BeginForm("Index", "Campain", new AjaxOptions { HttpMethod = "POST" }, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form", id = "frmAcceptContactL1" }))
            {
                @Html.AntiForgeryToken()
                <div class="row" style="margin-left: 30px;">
                    <div class="col-xs-1" style="width: 5%;">
                        Mã
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Code", string.Empty, new { @style = "width: 100%" })
                        </div>
                    </div>
                    <div class="col-xs-1" style="width: 5%;">
                        Tên
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Name", string.Empty, new { @style = "width: 100%" })
                        </div>
                    </div>
                    <div class="col-xs-1" style="width: 8.5%;">
                        Lịch gọi từ
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Name", DateTime.Now.ToString("dd/MM/yyyy"), new { @style = "width: 100%" })
                        </div>
                    </div>
                    <div class="col-xs-1" style="width: 4%;">
                        Đến
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Name", DateTime.Now.ToString("dd/MM/yyyy"), new { @style = "width: 100%" })
                        </div>
                    </div>
                </div>
                <hr />
                <div class="space-2"></div>
                <button id="btnFilterContact" class="btn-primary" style="margin-bottom: 10px; float: right;">Lọc Contact</button>
                <div class="clearfix"></div>
                <div class="space-4"></div>
                <div class="row">
                    <div class="col-xs-12">
                        <table id="grid-table"></table>
                        <div id="grid-pager"></div>
                    </div>
                </div>
            }
            <!-- PAGE CONTENT ENDS -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</div>

<script type="text/javascript">
    var url = 'admin/api/contact/filterreuse?branchId={0}';
    var grid_selector = "#grid-table";
    var heades = ['Id', 'Mã', 'Tên', 'Ngày', 'Thời gian bắt đầu', 'Thời gian kết thúc', 'Trạng thái', 'Số lượng', 'Chức năng'];
    var model = [
        { name: 'Id', index: 'Id', editable: false, sorttype: 'string', editoptions: { disabled: true }, width: '0px' },
        { name: 'Fullname', index: 'Fullname', editable: false, sorttype: 'string', width: '100px' },
        { name: 'Fullname', index: 'Fullname', editable: false, sorttype: 'string', width: '100px' },
        { name: 'DateTime', index: 'LocationId', editable: true, sorttype: 'string', width: '80px' },
        { name: 'Mobile', index: 'Mobile', editable: false, sorttype: 'string', width: '80px' },
        { name: 'Email', index: 'Email', editable: false, sorttype: 'string', width: '80px' },
        { name: 'SchoolGrad', index: 'SchoolGrad', editable: false, sorttype: 'string', width: '80px' },
        { name: 'MajorGrad', index: 'MajorGrad', editable: false, sorttype: 'string', width: '80px' },
        { name: 'MajorGrad', index: 'MajorGrad', editable: false, sorttype: 'string', width: '80px' }
    ];

    $(document).ready(function () {
        var branchId = 0;
        setupGridWithoutEdit("#grid-table", "#grid-pager", url.format(branchId), "admin/api/contact/edit", "Id", "Danh sách Campain", heades, model);
        $(grid_selector).jqGrid("setGroupHeaders", {
            useColSpanStyle: true,
            groupHeaders: [
                { startColumnName: "DateTime", numberOfColumns: 3, titleText: '<table style="width:100%;border-spacing:0px;"><tr><td style="text-align:center;height:40px;"><b>Lịch gọi</b></td></tr></table>' }
            ]
        });
    });
</script>

